<?php
//http://www.winasm.net/forum/index.php?showtopic=1178
if(isset($_COOKIE['screenwidth']) && $_COOKIE['screenheight']) {
 //cookie found!
 $screenwidth = $_COOKIE['screenwidth'];
 $screenheight = $_COOKIE['screenheight'];
} else {
// Compatibility with browsers that do not process the javascript well, like WebPositive
setcookie("screenwidth",1024,time()+2500000);
setcookie("screenheight",768,time()+2500000);
//cookie is not found, so set it with JavaScript
$SITE_MIDDLE .= '
 <script language="javascript">
 <!--
 writeCookie();
 function writeCookie() {
 	var enddate = new Date("December 31, 2060");
 	document.cookie = "screenwidth="+ screen.width + ";expires=" + enddate.toGMTString();
	document.cookie = "screenheight="+ screen.height + ";expires=" + enddate.toGMTString();
 	window.location.replace("'. $_SERVER['PHP_SELF'] .'?'.$_SERVER['QUERY_STRING'] .'");
  }
   //-->
  </script>';  

}
if ($screenwidth < 1280) $LOWRES = true;
?>
